﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataMappers;
using ExaminationTT.Model;


namespace ConcreteMappersAndObjects.DomainObjects
{
    public struct CUSemesterKey
    {
        private int _cunitKey;
        private int _semesterKey;

        public CUSemesterKey(int cunitKey, int semesterkey)
        {
            _cunitKey = cunitKey;
            _semesterKey = semesterkey;
        }
        public int CUKey
        {
            get { return _cunitKey; }
        }

        public int SemesterKey
        {
            get { return _semesterKey; }
        }

  
    }
 
    public class CUSemester : DomainObject<CUSemesterKey, CUSemester> , ICUSemester
    {
        protected override CUSemester Self()
        {
            return this;
        }

        private IValueHolder<int, CUnit> _cunit;
        private IValueHolder<int, Semester> _semester;
        public CUSemester() : base()
        {
            _cunit = new ConcreteValueHolder<int, CUnit>();
            _semester = new ConcreteValueHolder<int, Semester>();
        }

        public CUSemester(CUSemesterKey ID, IValueHolder<int, CUnit> cunit, IValueHolder<int, Semester> semester)
            : base(ID)
        { 
            _cunit = cunit;
            _semester = semester;
        }

        public CUnit CUnit
        {
            get { return _cunit.Get(); }
            set { _cunit.Set(value); }
        }

        public Semester Semester
        {
            get { return _semester.Get(); }
            set { _semester.Set(value); }
        }


        #region ICUSemester Members

        ICUnit ICUSemester.CUnit
        {
            get { return _cunit.Get(); }
        }

        ISemester ICUSemester.Semester
        {
            get { return _semester.Get(); }
        }

        #endregion
    }
}
